﻿package com.videointeractive.util
{
	import flash.text.TextField;
	import flash.text.AntiAliasType;
	
	import com.videointeractive.tool.FontLoader;
	
	public class TextFieldUtil
	{
		static public function formatTextField( 
										 	pTextField : TextField,
										 	pAutoSize : String,
											pTextColor : uint,
											pX : Number,
											pY : Number,
											pText : String = null
											) : void
		{
			pTextField.embedFonts		= true;
			pTextField.antiAliasType 	= AntiAliasType.ADVANCED;
			pTextField.defaultTextFormat= FontLoader.textFormat;
			pTextField.autoSize 		= pAutoSize;
			pTextField.textColor 		= pTextColor;
			pTextField.x				= pX;
			pTextField.y				= pY;
						
			if ( pText )
				pTextField.text			= pText;
		}
	}
}